﻿function getstatparam() {
    return getRequestArg('statparam');
}

function getwxnumber() {
    return getRequestArg('wxnumber');
}

function getcoupon() {
    return getRequestArg('coupon');
}

function geterrmsg() {
    return getRequestArg('errmsg');
}

function getuid() {
    return getRequestArg('uid');
}

function getwpay() {
    return getRequestArg('wpay');
}
function getismalasong() {
    return getRequestArg('ismalasong');
}
function getactivityid() {
    return getRequestArg('activityid');
}
function getcomefrom() {
    return getRequestArg('comefrom');
}

function addwxnumber(url) {
    if (url.indexOf('?') == -1) {
        url += '?wxnumber=' + getwxnumber();
    } else {
        url += '&wxnumber=' + getwxnumber();
    }
    url += '&uid=' + getuid();
    url += '&coupon=' + getcoupon();
    url += '&statparam=' + getstatparam();
    url += '&wpay=' + getwpay();
    return url;
}

function getRequestArg(name) {
    var url = unescape(window.location.href);
    if (url.indexOf('?') == -1)
        return '';
    var allargs = url.split("?")[1];
    var args = allargs.split("&");
    for (var i = 0; i < args.length; i++) {
        var arg = args[i].split("=");
        if (arg[0] === name)
            return arg[1];
    }
    return '';
}